<template>
	<view>
		<view class="detail">
			<view class="title">
				<text>{{ detail.name }}</text>
			</view>
			<view class="content">
				<view
					class="rich"
					v-html="detail.content">
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { $get	} from "@/api/index.js"
	
	export default {
		data() {
			return {
				option: {},
				detail: []
			}
		},
		onLoad(option) {
			this.option = option
			this.getArticleDetail()
		},
		methods: {
			// 栏目数据
			async getArticleDetail () {
				const res = await $get('s=/ApiArticle/detail', {
					id: this.option.id
				})
				const { detail, pagecontent, status, msg } = res.data
				uni.setNavigationBarTitle({ title: '详情' });
				if (status == 1) {
					this.detail = detail
					this.detail.content = pagecontent[0].content
				} else {
					this.showToast(msg)
				}
			},
		}
	}
</script>

<style lang="less" scoped>
	.detail {
		min-height: 100vh;
		background: #f8f8f8;
		.title {
			padding: 40rpx;
			line-height: 1.5;
			font-size: 32rpx;
			font-weight: bold;
		}
		.content {
			position: relative;
			padding: 40rpx;
			color: #666;
			line-height: 2 !important;
		}
	}
	
	
</style>
